<template>
  <div id="app">
    <router-view/>
  </div>
</template>


<script>
import Vue from "vue";
import {getToken} from "@/utils/auth";
import jwtDecode from "jwt-decode";

export default {
  name: 'App',
  methods:{


  },
  mounted() {



    if (getToken()!=null)
    {
      let token=jwtDecode(getToken());
      let arr=[]
      arr.push(token.roles)
      this.$store.commit("SET_TOKEN",getToken())
      this.$store.commit("SET_ROLES",arr)
      this.$store.commit("SET_NAME",token.username)

    }




  }
}

</script>

<style>

</style>
